import {ZAN_JIA, ZAN_JIAN} from '../constants';
export default function zanReducer(state=10, action){
    //判断
    switch(action.type){
        case ZAN_JIA:
            return state + action.data;
        case ZAN_JIAN:
            return state - action.data;
        default:  //这个 default 必须要添加
            return state;
    }
}